
#include "RenderSystemFactory.h"
#include <windows.h>
namespace FlameEngine
{
	//class IRenderSystem;

	IRenderSystem* RenderSystemFactory::CreateRenderSystemManager(RenderSystemType rst)
	{
		uint32_t dllHandle = 0;
		if (rst == rst_dx9)
		{
			dllHandle = FileManager::LoadDll("RenderSystemDX9");
		}
		else if (rst == rst_dx11)
		{
			dllHandle = FileManager::LoadDll("RenderSystemDX11");
		}
		else
		{
			assert(false);
		}

		assert(dllHandle > 0);

		typedef IRenderSystem* (*RenderSystemEntry)();
		RenderSystemEntry renderSystemEntry = (RenderSystemEntry)GetProcAddress((HMODULE)dllHandle, "CreateRenderSystem");
		assert(renderSystemEntry > 0);

		return renderSystemEntry();
	}
}